import request from '../../utils/request';

// 橱窗管理相关 API

// 查询橱窗详情
export const getShowcaseDetail = (memberId: string) => {
    return request({
        url: `/product/api/showcase/member/${memberId}`,
        method: 'get'
    });
};

// 查询橱窗产品列表
export const getShowcaseProductList = (memberId: string, params?: any) => {
    return request({
        url: `/product/api/showcase/member/${memberId}/products`,
        method: 'get',
        params
    });
};

// 添加产品到橱窗
export const addProductToShowcase = (memberId: string, productId: string, data?: any) => {
    return request({
        url: `/product/api/showcase/member/${memberId}/products/${productId}`,
        method: 'post',
        data
    });
};

// 从橱窗移除产品
export const removeProductFromShowcase = (memberId: string, productId: string) => {
    return request({
        url: `/product/api/showcase/member/${memberId}/products/${productId}`,
        method: 'delete'
    });
};

// 生成橱窗链接
export const generateShowcaseLink = (memberId: string) => {
    return request({
        url: `/product/api/showcase/member/${memberId}/url`,
        method: 'get'
    });
};

// 查询需要审批的橱窗商品
export const getApprovedShowcaseProducts = (orgId: string, params?: any) => {
    return request({
        url: `/product/api/showcase/org/${orgId}/products`,
        method: 'get',
        params
    });
};
